import request from '@/utils/request'


export function investmentlistAPI(query) {
    return request({
      url: '/ny-iqc/cost/investment/list',
      method: 'get',
      params: query
    })
}
//
export function investmentapproveAPI(data) {
  return request({
    url: "/ny-iqc/cost/investment/approve",
    method: "PUT",
    data,
  });
}

export function revokeTrialInvestAPI(ids) {
  return request({
    url: "/ny-iqc/cost/investment/revokeTrialInvest/" + ids,
    method: "PUT",
  });
}


export function isInitiateAPI(data) {
  return request({
    url: "/ny-iqc/cost/investment/isInitiate",
    method: "post",
    data,
  });
}
/**
 * producing trial data query
 * ?materialCode=&status=&inspectionLotMark=
 */
export function queryProducingTrail(data){
  return request({
    url: "/ny-iqc/cost/investment/list",
    method: "get",
    params:data
  });
}

/**
 * approval trail item
 *
 * data:
 * {
	"trialInvestmentId": "id",
	"approveStatus": 1,
	"hasTwo": 0
  }
 */
export function approvalProducingTrail(data){
//cost/investment/approve
  return request({
    url: "/ny-iqc/cost/investment/approve",
    method: "post",
    data:data
  });
}


/**
 * approval trail item
 *
 * data:
 *{
    "trialInvestmentId":"id",
    "fileUrl":"文件地址"
}
*/
export function saveTrailFile(data){
//cost/investment/approve
  return request({
    url: "/ny-iqc/cost/investment/pushFileUrl",
    method: "post",
    data:data
  });
}

export function pushToMes(data){
//cost/investment/approve
  return request({
    url: "/ny-iqc/cost/investment/pushToMes",
    method: "post",
    data
  });
}

export function pullMesData(id){
//cost/investment/approve
  return request({
    url: `/ny-iqc/cost/investment/pullMesData/${id}`,
    method: "get",
  });
}